package com.rc.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.rc.activity.R;

public final class SplaceScreenFragment extends Fragment {
	private static final String KEY_TITLE = "TITLE";
	private static final String KEY_DESCRIPTION = "DESCRIPTION";
	private static final String KEY_IMAGE = "IMAGE";
	private int title;
	private int description;
	private int image;

	// private int background;

	public SplaceScreenFragment newInstance(int title, int description,
			int image) {
		SplaceScreenFragment fragment = new SplaceScreenFragment();
		fragment.title = title;
		fragment.description = description;
		fragment.image = image;
		// fragment.background = bg;
		return fragment;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		if ((savedInstanceState != null)) {
			if (savedInstanceState.containsKey(KEY_TITLE)) {
				title = savedInstanceState.getInt(KEY_TITLE);
			}
			if (savedInstanceState.containsKey(KEY_DESCRIPTION)) {
				description = savedInstanceState.getInt(KEY_DESCRIPTION);
			}
			if (savedInstanceState.containsKey(KEY_IMAGE)) {
				image = savedInstanceState.getInt(KEY_IMAGE);
			}
			/*
			 * if (savedInstanceState.containsKey(KEY_BG)) { background =
			 * savedInstanceState.getInt(KEY_BG); }
			 */
		}
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		ViewGroup v = (ViewGroup) inflater.inflate(R.layout.intro_page, null);
		return v;
	}

	@Override
	public void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		outState.putInt(KEY_TITLE, title);
		outState.putInt(KEY_DESCRIPTION, description);
		outState.putInt(KEY_IMAGE, image);
		// outState.putInt(KEY_BG, background);
	}
}
